import java.util.Scanner;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2022/12/13 15:40
 * @copyright: 博为峰
 */
public class MethodParamTest {
    public static void login(Scanner scanner) {
        do {
            System.out.println("请输入用户名");
            String name = scanner.nextLine();
            System.out.println("请输入密码");
            String password = scanner.nextLine();
            if (name.equals("zhangsan") && password.equals("123")) {
                break;
            }
        } while (true);
    }

    public static void addStu(Scanner scanner, String[] stu) {
        System.out.println("请输入ID");
        String id = scanner.nextLine();
        System.out.println("请输入姓名");
        String name = scanner.nextLine();
        stu[0] = id;
        stu[1] = name;
    }

    public static void main(String[] args) {
        System.out.println("1.登录2.t退出");
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        switch (s) {
            case "1":
                login(scanner);
                String[] stu = new String[2];
                do {
                    System.out.println("1.新增2.删除3.修改4.遍历5.退出");
                    String choice = scanner.nextLine();
                    switch (choice) {
                        case "1":
                            addStu(scanner, stu);
                            break;
                        case "2":
                            //删除
                            break;
                        case "3":
                            //修改
                            break;
                        case "4":
                            //遍历
                            for (int i = 0; i < stu.length; i++) {
                                System.out.println(stu[i]);
                            }
                            break;
                        case "5":
                            //退出
                            break;
                        default:
                            System.out.println("请输入正确的操作");
                    }
                } while (true);

//                break;

            case "2":
                //退出
                break;
            default:
                System.out.println("请输入正确的操作");
        }
    }
}
